package org.jeecg.modules.website.mapper;

import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.website.entity.JcChannel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * @Description: jc_channel
 * @Author: jeecg-boot
 * @Date:   2020-06-21
 * @Version: V1.0
 */
public interface JcChannelMapper extends BaseMapper<JcChannel> {

    @Select("select * from jc_channel sun where parentid in (select id from jc_channel where channel_code=#{parentCode}) order by sequence")
    List<JcChannel> getChannelListByParentCode(@Param("parentCode") String parentCode);

    @Select("select * from jc_channel parent where parentid = ''")
    List<JcChannel> getParentChannelByCode(@Param("channelCode") String channelCode);
}
